package com.loongtech.bi.entity.system;

import com.loongtech.core.jpa.entity.EntityIntAutoWithoutVersion;

import javax.persistence.*;

@Entity
@Table(name = "system_project")
public class EntitySysProject extends EntityIntAutoWithoutVersion {
	private static final long serialVersionUID = 1L;
	//工程名称
	@Column(columnDefinition = "varchar(255) NOT NULL default ''")
	private String projectName;
	//工程路径
	@Column(columnDefinition = "varchar(255) NOT NULL default ''")
	private String projectUrl;
    //工程描述
    @Column(columnDefinition = "varchar(255)")
    private String description;
    //排序标识
    @Column(columnDefinition = "varchar(255) default 0")
    private Integer sortId;
    // 创建时间
    @Column
    private long creatTime;

    public String getProjectName() {
        return projectName;
    }

    public void setProjectName(String projectName) {
        this.projectName = projectName;
    }

    public String getProjectUrl() {
        return projectUrl;
    }

    public void setProjectUrl(String projectUrl) {
        this.projectUrl = projectUrl;
    }

    public long getCreatTime() {
        return creatTime;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public Integer getSortId() {
        return sortId;
    }

    public void setSortId(Integer sortId) {
        this.sortId = sortId;
    }

    @PrePersist
    public void createUpdate() {
        this.setCreatTime(System.currentTimeMillis());
    }

    public void setCreatTime(long creatTime) {
        this.creatTime = creatTime;
    }

    @Override
    public String toString() {
        return "EntitySysProject{" +
                "projectName='" + projectName + '\'' +
                ", projectUrl='" + projectUrl + '\'' +
                ", id=" + id +
                ", description='" + description + '\'' +
                ", sortId=" + sortId +
                ", creatTime=" + creatTime +
                '}';
    }
}